package net.sxnic.jhitem.itemoperation.action;
import net.sxnic.jhitem.itemoperation.ItemOperationManager;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

public class Create extends ItemOperationAction {
   
	private static Logger logger = LoggerFactory.getLogger(Create.class);
	@Autowired
	ItemOperationManager itemOperationManager;
	 
    public String execute() throws Exception {
    	 
    	 try{
    		 itemOperation.setCatalog1("linfenitem");
    		 itemOperation.setCatalog2("001");
    		 itemOperationManager.save(itemOperation);
    		 addActionMessage("创建成功");
    		 logger.debug("新增计划类别！"+itemOperation.getSoperName()+"成功");
    	 }catch(Exception e){
    		 e.printStackTrace();
    		 logger.debug("创建失败!");
    	 }
    	
    	return SUCCESS;
    }
}
